package com.autism.day06;

import java.util.Scanner;

public class Register {
    static String[] usernameList = {"autism", "suojj"};

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String username = scanner.next();
        checkUser(username);
    }

    //校验user
    public static void checkUser(String username) {
        for (String name : usernameList) {
            if (name.equals(username)) {
//                throw new RegisterException("该用户已被注册！");
                try {
                    throw new RegisterException("该用户已被注册！");
                } catch (RegisterException e) {
                    e.printStackTrace();
                    return;
                }
            }
        }
        System.out.println("register success!");
    }
}
